package com.codermn.demo3;

import java.util.Random;

/**
 * @author jxau_scf
 * @date 2021/5/31 - 16:52
 */
public class MyMathRandom {
    public static void main(String[] args) {
        //方式1
        int random1 = (int) (Math.random() * 100);
        System.out.println(random1);

        //方式2
        Random random = new Random();
        int random2 = random.nextInt(100)+1;
        System.out.println(random2);
    }
}
